

include ../common.mk

TARGET:= ../main/decoder.a

SUB_MDL_LIST := libmpeg2 libvo

SRC_LIST:= mpeg2decoder.cpp 

OBJ_LIST:= mpeg2decoder.o 

INCLUDE := -Iinclude -I../portable/ -I../dvb/

$(TARGET): $(OBJ_LIST)
	@-mkdir tmp 
	@cd libmpeg2 && make
	@cd libmpeg2/.libs && cp libmpeg2.a ../../tmp 
	@cd libmpeg2/convert/.libs && cp libmpeg2convert.a ../../../tmp 
	@cd libvo && make && cp libvo.a ../tmp
	@cd tmp && ar -x libmpeg2.a && ar -x libmpeg2convert.a &&  ar -x libvo.a
	@cd tmp && ar -r ../$@ *.o
	ar -r $@ $(OBJ_LIST)
	

mpeg2decoder.o: mpeg2decoder.cpp
	g++ $(FLAG) $(INCLUDE) -c -o mpeg2decoder.o mpeg2decoder.cpp
	

test:$(TEST_LIST)
	@echo TARGET=$(TARGET)
	@echo MDL_LIST=$(MDL_LIST)
	@echo ARC_LIST=$(ARC_LIST)
	@echo TEST_LIST=$(TEST_LIST)
	@echo CLEAN_LIST=$(CLEAN_LIST)
	@echo INCLUDE=$(INCLUDE)
	@echo FLAG=$(FLAG)

clean: 
	@cd libmpeg2 && make clean
	@cd libvo && make clean
	rm -f $(OBJ_LIST) $(TARGET)
	


